Обновить

«Purple" I2P - a window into the world of C++ applications

Время на прочтение 3 min
Количество просмотров 37K
It is known that the official I2P is written in Java, which in itself repels potential users, thereby making the network less polarized than it could be. In addition, Java applications are quite resource-demanding, so running I2P on weak devices is difficult and sometimes impossible. It also turned out that Java in Africa is not the same Java, and support for strong cryptography depends on the country, which is why the mass transition to ECDSA had to be postponed.
Therefore, implementing I2P in C++ has always been a pressing task. Of the many attempts, Purple I2P is by far the most successful and practical. The name comes from the color of the shirt on the I2P icon, to distinguish it from the official I2P, where the color is red and denotes the family of applications that use this implementation of I2P. i2pd is also a general purpose I2P router.


image

Previously I reviewed the components necessary to build such a system. In short, to work on an I2P network you need a router that implements the following functions:
  • Transport responsible for direct connections with other nodes. Typically via the Internet, but can also be via other networks, for example Tor
  • Building and sending data through tunnels
  • Search and maintain the list of other nodes up to date
  • Transfer of transit traffic of other participants

If there is a need to exchange your own data, then the router needs to place addresses, the operation of which requires additional protocols, discussed Here. However, to interact with clients, data transfer alone is not enough - you must be able to manage local addresses and be able to access remote ones. In the official I2P this is implemented as a set of separate external applications, while in i2pd these services are built-in. Currently implemented:
  1. HTTP proxy
  2. I2P tunnels, which are maps of addresses to TCP ports of a local machine
  3. SAM - command interface. Let's look at it in more detail.


SAM protocol


SAM(Simple Anonymous Messaging) for a long time was actually the only protocol suitable for full interaction with I2P from C++ applications. More precisely, there is more BOB, actually implementing the same concept, but much less widespread than SAM.
The I2CP protocol recommended by the official I2P is of little use for these purposes, since it is a lower-level protocol and uses an external thread implementation, also written in Java. There is no C++ version at the moment. In the future, it is planned to formalize the implementation of streams from i2pd in the form of a separate library working via I2CP.
For SAM, there is a ready-to-use C++ library i2psam, which is actively used by cryptocurrencies to hide their traffic.
Despite its shortcomings and criticisms, SAM is the most important protocol in I2P purple because linking an existing C++ application using SAM and i2pd allows you to immediately eliminate the use of Java without additional rework..
The most popular ones:
  1. I2P-Messenger
  2. iMule
  3. Bitcoin-I2P

In general, the protocol fully lives up to its name; from the client’s point of view, it represents sockets operating either in command mode or in data transfer mode. If a client deletes a socket, the corresponding I2P construct is deleted. The work begins with creating a local address with keys specified by the client, or a temporary one with randomly generated keys. It can then either use this address to establish a connection to the remote address, or wait for the next incoming connection from the remote address. After this, the socket goes into data transfer mode.
Such an interface can be implemented as an API and used directly from the application, without the need to use an external router, and distributed as a ready-made solution without forcing the end user into the details of I2P settings.

What is planned to be implemented


  1. I2CP so that Java applications can run over i2pd
  2. Node profiler to build faster, more reliable tunnels
  3. Updated address book
  4. Datagrams
  5. Floodfill mode


Release 0.1.0


Actually, the main idea of ​​this article is that the first stable i2pd release containing the above functionality.

Binaries for Ubuntu:
launchpad.net/~i2p.packages/+archive/ubuntu/i2p

for Debian
deb.i2p2.no

For all other platforms compile from source from here.
Requires crypto++ and boost libraries.
Tags:
Hubs:
Всего голосов 37: ↑35 и ↓2 +33
Комментарии 25
+25

Comments 25

The news is certainly positive. I’ve been following the project for a long time and am waiting for workable versions…
Still on OS X
MacBook-Pro:i2pd Shift$ ./i2p 
Segmentation fault: 11
It works for me on 10.9 and 10.10. Try deleting the ~/.i2pd folder
There really is some kind of problem with the assembly due to the latest update from Apple.
That's why they didn't release it for OS X. Let's figure it out.
Did not help
crypto++ where do you get it from??
A UFO flew in and published this inscription here
That’s great - take and implement “in ordinary ways, without any advantages, frameworks and other hipsterism” protocols, which by the way are currently well documented.
I tried my best on the pluses, you will definitely do better.
A UFO flew in and published this inscription here
There are no problems with using C++, but with boost there are already tensions…
For example, someone might want to adapt your project into an openwrt tree, but when they see the boost in the dependencies, it will quickly break off.
Boost is already in the openwrt tree/turnips starting with Chaos Calmer. For Barrier Braker it is also assembled.
And this is your fork i2pcpp, or try to implement everything again?
No, not a fork. Work on i2pcpp began much later and they don’t have anything that works yet…
No, this is a completely custom implementation.
As stated later, i2pcpp was never intended to create a usable system. Currently work on it has stopped.
And you don’t have a timeline for when it will finally work as a full-fledged replacement for the Java implementation? :)
And then something, here, collected from today’s git HEAD has been hanging for half a day, and that’s it
LeaseSets: 0
, although there are already a bunch of routers and floodfills :(
Well, it doesn't go anywhere :(
Well, it was worth writing how he SUDDENLY found a LeaseSet :) However, there is still only one :(
LeaseSet and should be zero if not floodfil.
If there is something other than zero, it means it was caught in transit traffic from older versions when LeaseSets were unencrypted.

If it doesn’t work anywhere, then let’s figure out where exactly it’s not working..
Most likely the address is not in the address book, but not because you need to register normal sources in subscritptions.txt
1) What are “normal sources”?? :)
I have there i2p-projekt.i2p/hosts.txt ;)
2) So it doesn’t go to b32 addresses. The proxy gives 500. And when I try to open localhost:7070/zmw2cyw2vj7f6obx3msmdvdepdhnw2ctc4okza2zjxlukkdfckhq.b32.i2p - says No LeaseSet Found.
3) And it has already crumbled a couple of times during the night. But because was launched as a service - no backtrace yet.
3. What platform??
Linux (Gentoo ~amd64)
// By the way, semi-offtopic: I’m still trying to assemble it for the router, but because of the boost (?) I’m getting a failure :(
Here is a piece of the buildlog
Add i2pd -latomic to the makefile
About the assembly for openvrt - the makefile and patches can be found here:
github.com/PurpleI2P/i2pd/issues/345
By the way, I have a similar thing on openvert on the latest versions - the router works for 6+ hours, but does not go to addresses:
12:09:54/info - SOCKS: requested i2p-projekt.i2p:80
12:09:54/warn — Remote destination i2p-projekt.i2p not found
12:09:54/error — SOCKS: error when creating the stream, check the previous warnings for more info
12:09:54/warn - SOCKS: v5 request failed: 4
Well, I have it even on normal Linux and for a very long time, not only on the latest versions :-/
Do you happen to have a realtime chat somewhere outside of i2p? :) Chat about the settings there, that's all… :)

Well, so as not to get up twice: And there is no way to limit the number of connections created other than floodfill=1/0 and bandwidth=O/L?

Otherwise, with floodfill=0 and bandwith=L, it hung on me all day and didn’t catch a single LeaseSet.
And with floodfill=1 and bandwidth=O, it becomes somehow sad to use regular Internet…
Only full-fledged users can leave comments. Sign in, Please.